
clear
set matsize 5000
cd <directory>
**********************************************************************************************************************
** Takes the raw productivity data and creates cleaned productivity variables
**********************************************************************************************************************

use combined_10_compatible.dta
rename	MfgQty	mfgqty
rename	RejectedQty	rejectedqty
rename	BudgetedHours	budgetedhours
rename	HrsReported	hrsreported
rename	BudgetedEff	budgetedeff
rename	ActualEff	actualeff
rename	Style	style
rename	ScheduleNo	scheduleno
rename	ScheduleQty	scheduleqty
rename	OperationNo	operationno
rename	ResourceNo	resourceno
gen pos = strpos(resourceno, "SEW")
gen factory = substr(resourceno, 1, pos-1)
drop M-AW pos
sort Date
save combined_production_with_heat.dta, replace		/* this is the intermediate combined file */

